//设置数据模型
import 'package:hive/hive.dart';

part 'settings_model.g.dart';
@HiveType(typeId:0)
class SettingsModel{
  @HiveField(0)
  final bool isDarkMode;

  @HiveField(1)
  final bool notificationsEnabled;

  @HiveField(2)
  final String languageCode;//语言设置字段

  SettingsModel({
   required this.isDarkMode,
   required this.notificationsEnabled,
    required this.languageCode
});
  SettingsModel copyWith({
    bool? isDarkMode,
    bool? notificationsEnabled,
    String? languageCode
}){
    return SettingsModel(isDarkMode: isDarkMode??this.isDarkMode,
        notificationsEnabled: notificationsEnabled??this.notificationsEnabled,
        languageCode:languageCode?? this.languageCode
    );
  }
}